/**
 * Project Name:sc-parent-service
 * File Name:MessageServiceImpl.java
 * Package Name:com.sc.service.impl
 * Date:2018年6月28日上午11:59:27
 * Copyright (c) 2018, bluemobi All Rights Reserved.
 */

package com.sc.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.sc.mapper.mapperhand.HandmessageMapper;
import com.sc.pojo.Message;
import com.sc.service.MessageService;

/**
 * Description: <br/>
 * Date: 2018年6月28日 上午11:59:27 <br/>
 * 
 * @author pengchengwang
 * @version
 * @see
 */
@Service
public class MessageServiceImpl implements MessageService {
    @Autowired
    private HandmessageMapper messageMapper;

    /**
     * 查询所有的通知信息
     *
     * @see com.sc.service.MessageService#selectAllMessage()
     */
    @Override
    public List<Message> selectAllMessage() {

        // Auto-generated method stub
        return messageMapper.selectAllMessage();
    }

    /**
     * 通知详情通过id查询信息
     *
     * @see com.sc.service.MessageService#selectMessageById(int)
     */
    @Override
    public Message selectMessageById(int id) {

        // Auto-generated method stub
        return messageMapper.selectMessageById(id);
    }

    /**
     * 发布通知信息
     *
     * @see com.sc.service.MessageService#insert(com.sc.pojo.Message)
     */
    @Override
    @Transactional
    public boolean insert(Message record) {
        boolean flag = false;
        int num = messageMapper.insert(record);
        if (num >= 1) {
            flag = true;
        }
        // Auto-generated method stub
        return flag;
    }
}
